import bus from '@/bus'
import { Poptip, Icon } from 'view-design';

const data = {
  status: '',
  storeName: '',
  date: '',
  total: 1,
  pageSize: window.$pageSize,
  current: 1,
  data: [],
  columns: [{
    title: '月份', 
    key: 'useMonth', 
    align: 'left',
    minWidth: 100
  }, {
    title: '领取/发放', 
    key: 'storeName', 
    align: 'left',
    minWidth: 150,
    tooltip: true,
    renderHeader: (h, params) => {
      return <Poptip trigger="hover" transfer width="200" word-wrap content="领取了或被发放了的对象">
                  <span>领取/发放</span>
                  <Icon type="ios-help-circle" />
              </Poptip>
  }
  }, {
    title: '抵扣总额(元)', 
    key: 'discountTotalAmount', 
    align: 'right',
    minWidth: 120,
    renderHeader: (h, params) => {
      return <Poptip trigger="hover" transfer width="220" word-wrap content="使用优惠券抵扣的总金额(元)">
                  <span>抵扣总额(元)</span>
                  <Icon type="ios-help-circle" />
              </Poptip>
  }
  }, {
    title: '数据(条)', 
    key: 'usedCount', 
    minWidth: 120,
    align: 'right'
  }, {
    title: '操作',
    key: 'operate',
    align: 'right',
    minWidth: 150,
    render: (h, params) => {
      const detailBtn = h('Button', {
        props: {
          size: 'small',
          type: 'primary'
        },
        on: {
          click: () => {
            bus.$emit('resetSearch') //清空搜索条件
            bus.$emit('onClickDetail', params.row)
          }
        }
      }, '明细')
      return h('div', [detailBtn])
    }
  }]
}

export default data